import * as moment from 'moment';
import 'moment/locale/zh-cn';
const FORMAT = 'YYYY-MM-DD HH:mm:ss';
moment.locale('zh-cn');
export const DateUtils = {
  getDateFormatSymbols(format?: string): string {
    if (!format) {
      format = FORMAT;
    }
    return moment().format(format);
  },

  currentDate(): Date {
    return moment().toDate();
  },

  addMonths(month: number): string {
    return moment().add(month, 'months').format(FORMAT);
  },

  formatDate(momentInput: string, format?: string): string {
    if (!format) {
      format = FORMAT;
    }
    return moment(momentInput).format(format);
  },
  diff(momentInput: string): number {
    return moment().diff(momentInput, 'seconds', true);
  },
};
